<?php
/**
 * Created by PhpStorm.
 * User: cen
 * Date: 2020/6/27
 * Time: 11:04
 */

namespace app\admin\model;


use think\Model;

class MessageModel extends Model
{
    protected $table = "message";
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;

    // 定义全局的查询范围
    protected function base($query)
    {
        $query->where('status',0);
    }


    public function user()
    {
        return $this->belongsTo('UserModel','user_id');
    }

}